<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\GoldCharge
 *
 * @property int $id
 * @property int $user_id
 * @property string $number
 * @property string $total_amount
 * @property string|null $paid_at
 * @property string|null $paid_method
 * @property string|null $paid_number
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\User|null $user
 * @method static \Database\Factories\GoldChargeFactory factory(...$parameters)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge query()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge whereNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge wherePaidAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge wherePaidMethod($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge wherePaidNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge whereTotalAmount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldCharge whereUserId($value)
 * @mixin \Eloquent
 */
class GoldCharge extends Model
{
    use HasFactory;
	
	protected $guarded = ['id'];
	
	protected $dates = [
		'paid_at'
	];
	
	public function isPaid()
	{
		return (bool)$this->paid_at;
	}
	
	public function user()
	{
		return $this->belongsTo(User::class);
	}
}
